<template>
<p>在一组备选项中进行单选</p>
<div class="warning custom-block"><p class="custom-block-title">WARNING</p><p><code>label</code> 作为 <code>value</code> 来使用已经被 <strong>废弃</strong>, 建议<code>label</code> 只用来表示展示的文字，这个被废弃的用法<strong>将会在</strong> <span class="vp-tag">3.0.0</span> 版本被移除，请考虑使用新 API 替换.</p></div>
<div class="tip custom-block"><p class="custom-block-title">TIP</p><p>新的 API <code>value</code> 已在 <span class="vp-tag">2.6.0</span> 版本添加，文档中的示例都将使用 <code>value</code>。 如果您使用的版本 <strong>低于</strong> <span class="vp-tag">2.6.0</span>，请参考：</p></div>
<div class="language-vue vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">vue</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&lt;</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">template</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">  &lt;</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio-group</span><span style="--shiki-light: #6F42C1; --shiki-dark: #B392F0;"> v-model</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">=</span><span style="--shiki-light: #032F62; --shiki-dark: #9ECBFF;">"</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">radio1</span><span style="--shiki-light: #032F62; --shiki-dark: #9ECBFF;">"</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light: #6A737D; --shiki-dark: #6A737D;">    &lt;!-- works when &gt;=2.6.0, recommended ✔️ not work when &lt;2.6.0 ❌ --&gt;</span></span>
<span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">    &lt;</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio</span><span style="--shiki-light: #6F42C1; --shiki-dark: #B392F0;"> value</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">=</span><span style="--shiki-light: #032F62; --shiki-dark: #9ECBFF;">"Value 1"</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;Option 1&lt;/</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light: #6A737D; --shiki-dark: #6A737D;">    &lt;!-- works when &lt;2.6.0, deprecated act as value when &gt;=3.0.0 --&gt;</span></span>
<span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">    &lt;</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio</span><span style="--shiki-light: #6F42C1; --shiki-dark: #B392F0;"> label</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">=</span><span style="--shiki-light: #032F62; --shiki-dark: #9ECBFF;">"Label 2 &amp; Value 2"</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;Option 2&lt;/</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">  &lt;/</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">el-radio-group</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span>
<span class="line"><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&lt;/</span><span style="--shiki-light: #22863A; --shiki-dark: #85E89D;">template</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;">&gt;</span></span></code></pre></div>
</template>
<style scoped>
@import '../../assets/elementPlusDemo.css'
</style>
